package types {
	import mx.collections.ArrayCollection;
	import org.davekeen.flextrine.orm.FlextrineError;
	
	[Bindable]
	public class TypesObjectEntityBase {
		
		[Transient]
		public var __isUnserialized__:Boolean;
		
		[Transient]
		public var __isInitialized__:Boolean = true;
		
		[Transient]
		public var __isCollectionInitializedMap__:Object = new Object();
		
		[Id]
		public var id:String;
		
		public function get integerField():Number { checkIsInitialized("integerField"); return _integerField; }
		public function set integerField(value:Number):void { _integerField = value; }
		private var _integerField:Number = 0;
		
		public function get smallIntField():Number { checkIsInitialized("smallIntField"); return _smallIntField; }
		public function set smallIntField(value:Number):void { _smallIntField = value; }
		private var _smallIntField:Number = 0;
		
		public function get bigIntField():Number { checkIsInitialized("bigIntField"); return _bigIntField; }
		public function set bigIntField(value:Number):void { _bigIntField = value; }
		private var _bigIntField:Number = 0;
		
		public function get decimalField():Number { checkIsInitialized("decimalField"); return _decimalField; }
		public function set decimalField(value:Number):void { _decimalField = value; }
		private var _decimalField:Number = 0;
		
		public function get booleanField():Boolean { checkIsInitialized("booleanField"); return _booleanField; }
		public function set booleanField(value:Boolean):void { _booleanField = value; }
		private var _booleanField:Boolean;
		
		public function get textField():String { checkIsInitialized("textField"); return _textField; }
		public function set textField(value:String):void { _textField = value; }
		private var _textField:String;
		
		public function get stringField():String { checkIsInitialized("stringField"); return _stringField; }
		public function set stringField(value:String):void { _stringField = value; }
		private var _stringField:String;
		
		public function get dateField():Date { checkIsInitialized("dateField"); return (_dateField && _dateField.getTime() > 0) ? _dateField : null; }
		public function set dateField(value:*):void { _dateField = (value is Date) ? value : new Date(value); }
		private var _dateField:Date;
		
		public function get dateTimeField():Date { checkIsInitialized("dateTimeField"); return (_dateTimeField && _dateTimeField.getTime() > 0) ? _dateTimeField : null; }
		public function set dateTimeField(value:*):void { _dateTimeField = (value is Date) ? value : new Date(value); }
		private var _dateTimeField:Date;
		
		public function TypesObjectEntityBase() {
		}
		
		public function toString():String {
			return "[TypesObject id=" + id + "]";
		}
		
		private function checkIsInitialized(property:String):void {
			if (!__isInitialized__ && __isUnserialized__)
				throw new FlextrineError("Attempt to get property '" + property + "' on unitialized TypesObject.  Consider using EntityManager::require or eager loading.", FlextrineError.ACCESSED_UNITIALIZED_ENTITY);
		}
		
	}

}
